﻿using System;
using System.Collections.Generic;
using BrnMall.Core;
using BrnMall.Manager.Domain.Store;
using BrnMall.Manager.Domain.Product;
using BrnMall.Manager.Domain.Promotion;

namespace QIDong.WeApp.Models
{
    /// <summary>
    /// 店铺分类模型类
    /// </summary>
    public class StoreClassModel
    {
        /// <summary>
        /// 店铺分类id
        /// </summary>
        public int StoreCid { get; set; }
        /// <summary>
        /// 排序列
        /// </summary>
        public int SortColumn { get; set; }
        /// <summary>
        /// 排序方向
        /// </summary>
        public int SortDirection { get; set; }
        /// <summary>
        /// 分页对象
        /// </summary>
        public PageModel PageModel { get; set; }
        /// <summary>
        /// 商品列表
        /// </summary>
        public List<PartProductInfo> ProductList { get; set; }
        /// <summary>
        /// 店铺分类信息
        /// </summary>
        public StoreClassInfo StoreClassInfo { get; set; }
    }
    /// <summary>
    /// 店铺搜索模型类
    /// </summary>
    public class StoreSearchModel
    {
        /// <summary>
        /// 搜索词
        /// </summary>
        public string Word { get; set; }
        /// <summary>
        /// 排序列
        /// </summary>
        public int SortColumn { get; set; }
        /// <summary>
        /// 排序方向
        /// </summary>
        public int SortDirection { get; set; }
        /// <summary>
        /// 分页对象
        /// </summary>
        public PageModel PageModel { get; set; }
        /// <summary>
        /// 商品列表
        /// </summary>
        public List<ProductListOutDto> ProductList { get; set; }
    }
    /// <summary>
    /// 店铺订单
    /// </summary>
    public class StoreOrder
    {
        /// <summary>
        /// 店铺购物车信息
        /// </summary>
        public StoreCartInfo StoreCartInfo { get; set; }
        /// <summary>
        /// 商品合计
        /// </summary>
        public decimal ProductAmount { get; set; }
        /// <summary>
        /// 满减
        /// </summary>
        public int FullCut { get; set; }
        /// <summary>
        /// 配送费用
        /// </summary>
        public int ShipFee { get; set; }
        /// <summary>
        /// 商品总数量
        /// </summary>
        public int TotalCount { get; set; }
        /// <summary>
        /// 商品总重量
        /// </summary>
        public int TotalWeight { get; set; }
    }

    /// <summary>
    /// 店铺模型类
    /// </summary>
    public class StoreModel
    {
        private int _storeid;//店铺id
        private int _state;//状态(0代表营业,1代表关闭)
        private string _name;//名称
        private int _regionid;//区域id
        private int _storerid;//等级id
        private int _storeiid;//行业id
        private string _logo;//logo
        private DateTime _createtime;//创建时间
        private string _mobile;//手机
        private string _phone;//固定电话
        private string _qq;//qq
        private string _ww;//阿里旺旺
        private decimal _depoint;//商品描述评分
        private decimal _sepoint;//商家服务评分
        private decimal _shpoint;//商家配送评分
        private int _honesties;//店铺诚信值
        private DateTime _stateendtime;//状态结束时间
        private string _theme;//主题
        private string _banner;//Banner
        private string _announcement;//公告
        private string _description;//描述

        /// <summary>
        /// 店铺id
        /// </summary>
        public int StoreId
        {
            get { return _storeid; }
            set { _storeid = value; }
        }
        /// <summary>
        /// 状态(0代表营业,1代表关闭)
        /// </summary>
        public int State
        {
            get { return _state; }
            set { _state = value; }
        }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value.TrimEnd(); }
        }
        /// <summary>
        /// 区域id
        /// </summary>
        public int RegionId
        {
            get { return _regionid; }
            set { _regionid = value; }
        }
        /// <summary>
        /// 等级id
        /// </summary>
        public int StoreRid
        {
            get { return _storerid; }
            set { _storerid = value; }
        }
        /// <summary>
        /// 行业id
        /// </summary>
        public int StoreIid
        {
            get { return _storeiid; }
            set { _storeiid = value; }
        }
        /// <summary>
        /// logo
        /// </summary>
        public string Logo
        {
            get { return _logo; }
            set { _logo = value.TrimEnd(); }
        }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime
        {
            get { return _createtime; }
            set { _createtime = value; }
        }
        /// <summary>
        /// 手机
        /// </summary>
        public string Mobile
        {
            get { return _mobile; }
            set { _mobile = value.TrimEnd(); }
        }
        /// <summary>
        /// 固定电话
        /// </summary>
        public string Phone
        {
            get { return _phone; }
            set { _phone = value.TrimEnd(); }
        }
        /// <summary>
        /// qq
        /// </summary>
        public string QQ
        {
            get { return _qq; }
            set { _qq = value.TrimEnd(); }
        }
        /// <summary>
        /// 阿里旺旺
        /// </summary>
        public string WW
        {
            get { return _ww; }
            set { _ww = value.TrimEnd(); }
        }
        /// <summary>
        /// 商品描述评分
        /// </summary>
        public decimal DePoint
        {
            get { return _depoint; }
            set { _depoint = value; }
        }
        /// <summary>
        /// 商家服务评分
        /// </summary>
        public decimal SePoint
        {
            get { return _sepoint; }
            set { _sepoint = value; }
        }
        /// <summary>
        /// 商家配送评分
        /// </summary>
        public decimal ShPoint
        {
            get { return _shpoint; }
            set { _shpoint = value; }
        }
        /// <summary>
        /// 店铺诚信值
        /// </summary>
        public int Honesties
        {
            get { return _honesties; }
            set { _honesties = value; }
        }
        /// <summary>
        /// 状态结束时间
        /// </summary>
        public DateTime StateEndTime
        {
            get { return _stateendtime; }
            set { _stateendtime = value; }
        }
        /// <summary>
        /// 主题
        /// </summary>
        public string Theme
        {
            get { return _theme; }
            set { _theme = value.TrimEnd(); }
        }
        /// <summary>
        /// Banner
        /// </summary>
        public string Banner
        {
            get { return _banner; }
            set { _banner = value.TrimEnd(); }
        }
        /// <summary>
        /// 公告
        /// </summary>
        public string Announcement
        {
            get { return _announcement; }
            set { _announcement = value.TrimEnd(); }
        }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description
        {
            get { return _description; }
            set { _description = value.TrimEnd(); }
        }

        public string Address { get; set; }
        public string Fax { get; set; }
        /// <summary>
        /// 地理坐标
        /// </summary>
        public string Location { get; set; }
        /// <summary>
        /// 距离米
        /// </summary>
        public double Distance { get; set; }
        /// <summary>
        /// 距离显示字符串
        /// </summary>
        public string DistanceShow { get; set; }
        /// <summary>
        /// 区域名
        /// </summary>
        public string RegionName { get; set; }
    }
    /// <summary>
    /// 组件
    /// </summary>
    public class WidgetModel
    {
        /// <summary>
        /// 基本信息
        /// </summary>
        public Widget Widget { get; set; }
        /// <summary>
        /// 配置信息
        /// </summary>
        public IList<WidgetConfigOutDto> Config { get; set; }
    }
    /// <summary>
    /// 
    /// </summary>
    public class WidgetConfigOutDto
    {
        /// <summary>
        /// ID
        /// </summary>
        public int CId { get; set; }
        /// <summary>
        /// 组件ID
        /// </summary>
        public int WId { get; set; }
        /// <summary>
        /// 显示名称
        /// </summary>
        public string ShowName { get; set; }
        /// <summary>
        /// 显示图片
        /// </summary>
        public string ShowImg { get; set; }
        /// <summary>
        /// 链接类型
        /// </summary>
        public string LinkType { get; set; }
        /// <summary>
        /// 链接参数
        /// </summary>
        public LinkValue LinkValue { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int DisplayOrder { get; set; }
        /// <summary>
        /// 是否展示
        /// </summary>
        public bool IsShow { get; set; }
        /// <summary>
        /// 展示数量，挑选指定数量的商品
        /// </summary>
        public int DisplayCount { get; set; }
        /// <summary>
        /// 展示类型 
        /// 商品组件：0不展示，1小图列表，2大图列表，3双图列表
        /// 图片组件：11一图，12二图，13三图，14四图，15五图
        /// </summary>
        public int DisplayType { get; set; }
        /// <summary>
        /// 展示的商品列表
        /// </summary>
        public IList<ProductListOutDto> DisplayProductInfos { get; set; }
        /// <summary>
        /// 组件的显示位置
        ///0：未定义， 1:首页搜索框下，2：首页导航按钮下，3：首页内容下，4：首页商品下
        /// </summary>
        public int DisplayPosition { get; set; }
        /// <summary>
        /// 首页图片组件的特性集合
        /// </summary>
        public IList<LinkValue> CustomerFeatures { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public WidgetConfigOutDto()
        {
            ShowImg = LinkType = ShowName = string.Empty;
            DisplayOrder = DisplayCount = DisplayType = DisplayPosition = 0;
            IsShow = true;
            LinkValue = new LinkValue();
            DisplayProductInfos = new List<ProductListOutDto>();
        }
    }
    /// <summary>
    /// 链接
    /// </summary>
    public class LinkValue
    {
        /// <summary>
        /// 参数ID
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 参数名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 路径
        /// </summary>
        public string Url { get; set; }
        /// <summary>
        /// 链接类型
        /// </summary>
        public string LinkType { get; set; }
        /// <summary>
        /// 展示图
        /// </summary>
        public string ShowImg { get; set; }
        /// <summary>
        /// 所在的组件的中的位置
        /// </summary>
        public string LinkArea { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public LinkValue()
        {
            Id = Name = Url = LinkType = ShowImg = LinkArea = string.Empty;

        }
    }
    /// <summary>
    /// 店铺预约记录
    /// </summary>
    public class ProductAppointListModel
    {
        /// <summary>
        /// 分页对象
        /// </summary>
        public PageModel PageModel { get; set; }
        /// <summary>
        /// 结果
        /// </summary>
        public List<ProductAppoint> Result { get; set; }
        /// <summary>
        /// 账号名
        /// </summary>
        public string AccountName { get; set; }
        /// <summary>
        /// 商品id
        /// </summary>
        public int Pid { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string ProductName { get; set; }


        /// <summary>
        /// 咨询开始时间
        /// </summary>
        public string AppointStartTime { get; set; }
        /// <summary>
        /// 咨询结束时间
        /// </summary>
        public string AppointEndTime { get; set; }
    }
    #region 拼团活动
    /// <summary>
    /// 拼团商品
    /// </summary>
    public class GroupBuyProductModel
    {
        /// <summary>
        /// 
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 拼团活动
        /// </summary>
        public GroupBuyModel GroupBuy { get; set; }

        /// <summary>
        /// 拼团商品
        /// </summary>
        public PartProductInfo Product { get; set; }
        /// <summary>
        /// 拼团价
        /// </summary>
        public decimal GroupBuyPrice { get; set; } = 0;

        /// <summary>
        /// 拼团进度
        /// </summary>
        public string BuyStatus { get; set; }
    }
    /// <summary>
    /// 拼团商品列表
    /// </summary>
    public class GroupBuyProductListModel
    {
        /// <summary>
        /// 翻页
        /// </summary>
        public PageModel Page { get; set; }

        /// <summary>
        /// 商品
        /// </summary>
        public IList<GroupBuyProductModel> Items { get; set; }
        /// <summary>
        /// 设置
        /// </summary>
        public GroupBuySetting Setting { get; set; }
    }
    /// <summary>
    /// 拼团商品列表
    /// </summary>
    public class GroupBuyProductListIndexModel
    {

        /// <summary>
        /// 商品
        /// </summary>
        public IList<GroupBuyProductModel> Items { get; set; }

    }
    /// <summary>
    /// 
    /// </summary>
    public class GroupBuyModel
    {
        public int Id { get; set; }

        /// <summary>
        /// 店铺ID
        /// </summary>
        public int StoreId { get; set; } = 0;

        /// <summary>
        /// 拼团名称
        /// </summary>
        public string Name { get; set; } = "";

        /// <summary>
        /// 拼团人数
        /// </summary>

        public int LimitBuyerCount { get; set; } = 0;

        /// <summary>
        /// 拼团限时
        /// </summary>
        public int LimitHour { get; set; } = 0;

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime StartTime { get; set; } = new DateTime(1900, 1, 1);

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime EndTime { get; set; } = new DateTime(1900, 1, 1);

        /// <summary>
        /// 每位用户可同时进行的团数
        /// </summary>
        public int LimitJoinCount { get; set; } = 0;

        /// <summary>
        /// 每位用户每次参团时可购买件数
        /// </summary>
        public int LimitBuyCount { get; set; } = 0;

        /// <summary>
        /// 0:开启，1：关闭
        /// </summary>
        public int Status { get; set; } = 0;
    }

    #endregion

    #region 门店

    public class BranchModel
    {
        /// <summary>
        /// 门店ID
        /// </summary>
        public int bid { get; set; }
        /// <summary>
        /// 门店名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 纬度
        /// </summary>
        public string latitude { get; set; }
        /// <summary>
        /// 经度
        /// </summary>
        public string longitude { get; set; }
        /// <summary>
        /// 距离
        /// </summary>
        public string distance { get; set; }
        /// <summary>
        ///距离多少米
        /// </summary>
        public double metre { get; set; }
    }

    public class BranchListModel
    {
        public IList<BranchModel> List { get; set; }

        public PageModel PageModel { get; set; }
    }
    #endregion
}
